//
//  NSString+Common.h
//  beichoo_N_ios
//
//  Created by 陈健 on 2017/8/21.
//  Copyright © 2017年 陈健. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSString (Common)

//加密
- (NSString *)md5Str;
- (NSString *)sha1Str;
- (NSString *)passwordEncrypt;

//根据font和size拿到文字宽度
- (CGSize)getSizeWithFont:(CGFloat)font constrainedToSize:(CGSize)size;
- (CGFloat)getHeightWithFont:(CGFloat)font constrainedToSize:(CGSize)size;
- (CGFloat)getWidthWithFont:(CGFloat)font constrainedToSize:(CGSize)size;

//判断是否为整形
- (BOOL)isPureInt;
//判断是否为浮点形
- (BOOL)isPureFloat;
//判断是否是手机号码或者邮箱
- (BOOL)isPhoneNo;
- (BOOL)isEmail;
+ (BOOL)valiMobile:(NSString *)mobile;
//判断密码是否标准
- (BOOL)checkPassword;
- (BOOL)isGK;
- (BOOL)isFileName;

/**
 UrlEncode/UrlDecode方法的实现 URLDEcode
 
 @param unencodedString 进行编码
 @return 返回到编码
 */
+ (NSString*)encodeString:(NSString*)unencodedString;

/**
 反URL编码
 
 @param encodedString 进行的编码
 @return 返回的编码
 */
+ (NSString *)decodeString:(NSString*)encodedString;


+ (NSString *)shortUrlString:(NSString *)longUrlString;
/**
 判断字符串是否为空
 
 */
+ (BOOL)isBlankString:(NSString *)string;


/**
 获取当前设备UUID
 @return 返回UUID的值
 */
+ (NSString *)getUniqueStrByUUID;

@end
